import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
 
// A Swing GUI application inherits from top-level container javax.swing.JFrame
public class guiTemplate extends JFrame 
{
   // private variables
   // ......
 
   /** Constructor to setup the GUI components */
   public guiTemplate() 
   {
	  //Call super class JFrame's constructor
	  super();
      Container cp = this.getContentPane();
 
      // Content-pane sets layout
      // cp.setLayout(new ....Layout());
 
      // Allocate the GUI components
      // .....
 
      // Content-pane adds components
      // cp.add(....);
 
      // Source object adds listener
      // .....
 
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         // Exit the program when the close-window button clicked
      setTitle("Java GUI app template");  // "this" JFrame sets title
      setSize(500, 300);   // "this" JFrame sets initial size (or pack())
      setVisible(true);    // show it
   }
 
   /** The entry main() method */
   public static void main(String[] args) 
   {
      // Run GUI codes in Event-Dispatching thread for thread-safety
      SwingUtilities.invokeLater(new Runnable() 
      {
         @Override
         public void run() 
         {
            new guiTemplate();  // Let the constructor do the job
         }
      });
   }
} 